﻿using System.Text.RegularExpressions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Rosetta.Default.AddIns.RegularExpressions;

namespace Rosetta.Tests.Default
{
    [TestClass]
    public class RegexConverterTests
    {
        #region Public Methods

        [TestMethod]
        public void TestComplete()
        {
            var regexConverter = new RegexConverter();

            var regexCreate = regexConverter.Convert<string, Regex>("Create");
            var regex = regexCreate("test...");

            Assert.AreEqual(true, regex.IsMatch("testlol"));

            Assert.IsTrue(regexConverter.Convert<Regex, string, bool>("IsMatch")(regex, "testlol"));
        }

        #endregion
    }
}